int Date::operator-(const Date& d)
{
	Date max = *this;
	Date min = d;
	int flag = 1;
	int n = 0;
	if (*this < d) {
		max = d;
		min = *this;
		flag = -1;
	}
	n += (max._year - min._year + 1) * 365;
	for (int i = min._year; i <= max._year; i++)
		if (i % 4 == 0 && i % 100 != 0 || i % 400 == 0)
			++n;
	Date tmpmax(max._year + 1, 1, 1); int tmp1 = 0;
	Date tmpmin(min._year, 1, 1); int tmp2 = 0;
	while (tmpmax != max) {
		++max;
		++tmp1;
	}
	while (tmpmin != min) {
		++tmpmin;
		++tmp2;
	}
	n -= tmp1;
	n -= tmp2;
	return n * flag;
}